//
// Created by feng on 19-4-17.
//

#ifndef SOLARENERGY_CHIER_IMAGESAVER_H
#define SOLARENERGY_CHIER_IMAGESAVER_H

#include <string>
// #include <cuda_runtime.h>
// #include <cuda_gl_interop.h>
#include "ColorBar.h"

namespace solar
{
    class ImageSaver
    {
        public:
            static auto saveText(int receiver_type, const std::string& filename, int height, int width,
                                 float* h_data, float receiver_pixel, int time, bool res,
                                 float& sum_power, float& maximum_flux, int& maximum_location_x,
                                 int& maximum_location_y, int precision = 2, int rows_package = 10)
                -> float;
            static void saveCSV(const std::string& filename, int height, int width, float* h_data,
                                float receiver_pixel, bool res, int experiment_times = 1);

            /**
             * 生成图像
             */
            static void saveImg(const std::string& file_path, int height, int width, float* data,
                                float max_val);
            // static void generateImgInDevice(uchar4* img, int height, int width, float* data,
            // float max_val);
            static ColorBar colorbar;
    };
} // namespace solar

#endif // SOLARENERGY_CHIER_IMAGESAVER_H
